﻿using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Windows.Forms;
using Models;

namespace AGVControlSystemPro
{
    public partial class FrmTrafficView : Form
    {
        public FrmTrafficView()
        {
            InitializeComponent();
            this.dgvTraffic.AutoGenerateColumns = false;
        }
        public void Receiver(List<TrafficInfo> list)
        {
            //try
            //{
            //    if (FrmMain.objFrmTrafficView != null && FrmMain.objFrmTrafficView.IsDisposed == false)
            //    {
            //        if (this.dgvTraffic.InvokeRequired && this.dgvTraffic.IsDisposed ==false)
            //        {
            //            this.dgvTraffic.Invoke(new Action<List<TrafficInfo>>(s => { this.dgvTraffic.DataSource = null; this.dgvTraffic.DataSource = s; }), list);
            //        }
            //    }            
            //}
            //catch (Exception ex)
            //{
                
            //    MessageBox.Show("交管显示异常，异常信息：" + ex.Message);
            //}
           
        }

        private void FrmTrafficView_FormClosed(object sender, FormClosedEventArgs e)
        {
            FrmMain.objFrmTrafficView = null;
            
        }
    }
}
